package com.prd.controller;


import com.prd.service.OaCompeteInsideService;
import com.prd.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * <p>
 * 内部竞聘详情数据表 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-29
 */
@RestController
@RequestMapping("/api/oaCompeteInside")
@Api(tags = "内部竞聘管理")
public class OaCompeteInsideController {

    @Autowired
    private OaCompeteInsideService service;

    @ApiOperation("获取内部竞聘分页列表")
    @GetMapping("page")
    public JsonData getPage(@RequestParam("date") @ApiParam("日期") Date date,
                            @RequestParam("type") @ApiParam("是否可竞聘") Integer type,
                            @RequestParam("size") @ApiParam("size") Integer size,
                            @RequestParam("page") @ApiParam("page") Integer page){

        return service.getPage(date,type,size,page);
    }

    @ApiOperation("获取内部竞聘列表")
    @GetMapping
    public JsonData getList(){

        return service.getList();
    }

    @ApiOperation("根据id获取竞聘详情")
    @GetMapping("/{id}")
    public JsonData getDetailById(@PathVariable("id") Long id){

        return service.getDetailById(id);
    }

}

